package com.example.taobaounion.utils;

import retrofit2.Retrofit;
import retrofit2.converter.gson.GsonConverterFactory;

public class RetrofitManager {

    private static final RetrofitManager ourInstance=new RetrofitManager();
    private final Retrofit mRetrofit;
    public static RetrofitManager getInstance(){
        return ourInstance;
    }
    private RetrofitManager(){
        //创建retrofit
        mRetrofit=new Retrofit.Builder()
                .baseUrl(Constants.BASE_URL)//设置BaseUrl
                .addConverterFactory(GsonConverterFactory.create())//设置转换器
                .build();
    }
    public Retrofit getRetrofit(){
        return mRetrofit;
    }

}
